#include "panic.h"
#include "dbgio.h"
#include "text_video.h"

void __panic(char *error,char *debuginfo,char *extra_err,char *file,uint32_t eip){
	set_attrib(0xF,0x1);
	//clear_video();//disabled for debug
	position(0,0,1);
	dprintf("Project Atlantis has encountered an error and has been shut down to protect your pc\n");
	if (extra_err != 0)
		dprintf("ERROR : %s  %s\n",error,extra_err);
	else
		dprintf("ERROR : %s\n",error);
	if (debuginfo != 0)
		dprintf("\n\nDebugging information:\n%s\n",debuginfo);
	if (file == 0)
		dprintf("Error occurred at 0x%x\n",eip);
	else 
		dprintf("Error occurred in %s\n",file);
	for (;;);
}